aboutsummaryrefslogtreecommitdiff
path: root/src/app/manga/[title]/[id]/[read]/currentReading.jsx
blob: 2db6d77c5fab417b44236da7e8467e5c9da38e3a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"use client";
import { useState, useEffect } from "react";
import styles from "./read.module.css";

export default function CurrentReading() {
	const [chapter, setChapter] = useState(null);
	const [volume, setVolume] = useState(null);

	useEffect(() => {
		setChapter(localStorage.getItem("chapter") || "");
		setVolume(localStorage.getItem("volume") || "");
	});

	return CR(chapter, volume);
}

function CR(chapter, volume) {
	return (
		<div className={styles.CurrentReadingContainer}>
			{chapter && volume && (
				<p>
					Reading: Vol {volume} Chapter {chapter}
				</p>
			)}
		</div>
	);
}